<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script>
    // for...in 遍历对象

    var obj = {
      name: '易烊千玺',
      age: 18,
      sex: '男',
      fu: function () { }
    }
    for (var k in obj) {
      console.log(k); // k 变量 输出得到的是属性名
      console.log(obj[k]); // obj[k] 得到的是属性值
    }
  </script>
</head>

<body>

</body>

</html>